package com.androidx.p013lv.player.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.SeekBar;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.player.C1387R;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import p000a.shuyu.p005a.video.StandardGSYVideoPlayer;

/* renamed from: com.androidx.lv.player.view.VideoPlayer */
public class VideoPlayer extends StandardGSYVideoPlayer {
    ImageView mCoverImage;

    public VideoPlayer(Context context, Boolean bool) {
        super(context, bool);
    }

    public VideoPlayer(Context context) {
        super(context);
    }

    public VideoPlayer(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    @Override // p000a.shuyu.p005a.video.StandardGSYVideoPlayer, p000a.shuyu.p005a.video.base.GSYVideoView
    public int getLayoutId() {
        return C1387R.C1392layout.video_player_layout;
    }

    /* access modifiers changed from: protected */
    @Override // p000a.shuyu.p005a.video.StandardGSYVideoPlayer, p000a.shuyu.p005a.video.base.GSYVideoControlView, p000a.shuyu.p005a.video.base.GSYBaseVideoPlayer, p000a.shuyu.p005a.video.base.GSYVideoView
    public void init(Context context) {
        super.init(context);
        this.mCoverImage = (ImageView) findViewById(C1387R.C1390id.thumbImage);
        if (this.mThumbImageViewLayout == null) {
            return;
        }
        if (this.mCurrentState == -1 || this.mCurrentState == 0 || this.mCurrentState == 7) {
            this.mThumbImageViewLayout.setVisibility(0);
        }
    }

    /* access modifiers changed from: protected */
    @Override // p000a.shuyu.p005a.video.StandardGSYVideoPlayer
    public void updateStartImage() {
        if (this.mStartButton instanceof ImageView) {
            ImageView imageView = (ImageView) this.mStartButton;
            if (this.mCurrentState == 2) {
                imageView.setImageResource(C1387R.C1389drawable.player_btn_video_pause);
            } else if (this.mCurrentState == 7) {
                imageView.setImageResource(C1387R.C1389drawable.player_btn_video_play);
            } else {
                imageView.setImageResource(C1387R.C1389drawable.player_btn_video_play);
            }
        }
    }

    /* access modifiers changed from: protected */
    @Override // p000a.shuyu.p005a.video.StandardGSYVideoPlayer
    public int getProgressDialogLayoutId() {
        return C1387R.C1392layout.video_player_progress_dialog;
    }

    /* access modifiers changed from: protected */
    @Override // p000a.shuyu.p005a.video.base.GSYVideoControlView
    public void touchSurfaceMove(float f, float f2, float f3) {
        super.touchSurfaceMove(f, f2, f3);
    }

    public void loadCoverImage(String str) {
        RequestManager with = Glide.with(getContext().getApplicationContext());
        ((RequestBuilder) ((RequestBuilder) ((RequestBuilder) with.load(str + "?m=2&w=" + 720 + "&h=" + 405).centerCrop()).error(C1387R.C1389drawable.base_ic_default_cover)).placeholder(C1387R.C1389drawable.base_ic_default_cover)).into(this.mCoverImage);
    }

    public void onPlayerPause() {
        onVideoPause();
        this.mTopContainer.setVisibility(8);
        this.mBottomContainer.setVisibility(8);
    }

    public int getProgress() {
        return this.mProgressBar.getProgress();
    }

    @Override // p000a.shuyu.p005a.video.base.GSYVideoControlView
    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
        super.onProgressChanged(seekBar, i, z);
        if (z) {
            this.mCurrentTimeTextView.setText(TimeUtils.stringForTime((long) ((i * getDuration()) / 100)));
        }
    }

    /* access modifiers changed from: protected */
    @Override // p000a.shuyu.p005a.video.base.GSYVideoControlView, p000a.shuyu.p005a.video.base.GSYBaseVideoPlayer
    public void lockTouchLogic() {
        if (this.mLockCurScreen) {
            this.mLockScreen.setImageResource(C1387R.C1389drawable.player_btn_on);
            this.mLockCurScreen = false;
            return;
        }
        this.mLockScreen.setImageResource(C1387R.C1389drawable.player_btn_off);
        this.mLockCurScreen = true;
        hideAllWidget();
    }

    @Override // p000a.shuyu.p005a.video.base.GSYVideoControlView
    public int getEnlargeImageRes() {
        return C1387R.C1389drawable.player_btn_amplification;
    }

    @Override // p000a.shuyu.p005a.video.base.GSYVideoControlView
    public int getShrinkImageRes() {
        return C1387R.C1389drawable.player_btn_zoom_out;
    }
}
